// pages/person-info/person-info.js
const app = getApp();

Page({

    /**
     * 页面的初始数据
     */
    data: {
        genders: ["男", "女"],
        groups: ["小学", "初中", "高中"],
        priGrade: ["一年级", "二年级", "三年级", "四年级", "五年级", "六年级"],
        secGrade: ["一年级", "二年级", "三年级"],
        senGrade: ["一年级", "二年级", "三年级"],
        userName: '',
        phoneNumber: ''
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.setData({
            phoneNumber: app.globalData.userId,
            userName: app.globalData.userName
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        this.getTabBar().setData({
            selected: 2
        })
    },

    logout: function () {
        app.logout();
        wx.reLaunch({
            url: '/pages/index/index'
        })
    }
})